package org.learn.test;
import java.util.Scanner;
public class MulForExercise01 {
    //统计三个班成绩情况，每个班五个同学
    // 求每个班学生总成绩和平均分。
    public static void main(String[] args) {
        Scanner myScanner = new Scanner(System.in);
        double totalScore = 0;//累计总分
        int passNum = 0;
     for ( int i = 1; i <= 3; i++){//i表示班级
       double sum = 0;
       for( int j = 1; j <= 5; j++){// j表示学生
           System.out.println("请输入第"+ i + "个班的第"+ j +"个学生的成绩");
           double score = myScanner.nextDouble();
           if(score >= 60){
               passNum++;
           }
           System.out.println(" 成绩为" + score);
           sum += score;
       }
        System.out.println("sum=" + sum + "平均分=" + sum / 5);
        totalScore += sum;
     }
        System.out.println("三个班总平均成绩=" + totalScore / 15);
        System.out.println("三个班及格人数=" + passNum);
    }
}
